/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.controler.jdbc;

import com.camachosanchez.util.ConexionSQL;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Zully
 */
public class MarcasNeumaticosJdbcControler {
    
    public byte eliminarMarca(int id) {
        byte estado = 0;
        try {
            Connection cn = ConexionSQL.obtenerConexion();
            CallableStatement sp = cn.prepareCall("{ call eliminar_marca_neumatico(?) }");
            sp.setInt("idMarca", id);
            ResultSet rs = sp.executeQuery();
            if(rs.next()){
                estado = rs.getByte(1);
            }
            rs.close();
            sp.close();
            cn.close();
        } catch (SQLException ex) {
            Logger.getLogger(MarcasNeumaticosJdbcControler.class.getName()).log(Level.SEVERE, null, ex);
        }
        return estado;
    }
}
